//
//  HomeFlowLayout.m
//  便签
//
//  Created by liujianlong on 2022/9/29.
//

#import "HomeFlowLayout.h"

@implementation HomeFlowLayout
- (NSArray<__kindof UICollectionViewLayoutAttributes *> *)layoutAttributesForElementsInRect:(CGRect)rect
{
    NSArray *attributes  = [[super layoutAttributesForElementsInRect:rect] copy];
    for (UICollectionViewLayoutAttributes *attr in attributes) {
        CGRect frame = attr.frame;
        if (frame.size.height < 300) {
            CGPoint origin = frame.origin;
            origin.y = origin.y - 60;
            frame.origin = origin;
            attr.frame = frame;
            attr.zIndex = attr.indexPath.row + 1;
        }else{
            attr.zIndex = 0;
        }
    }
    return  attributes;
}

@end
